package handlers;

import database.DBException;
import database.IDBContext;
import models.statistics.ICompressionStats;
import overclocking.container.IContainer;

import java.util.Collection;

public class StatisticsHandler implements IStatisticsHandler {
    private IDBContext dbContext;

    public StatisticsHandler(IContainer container) {
        this.dbContext = container.get(IDBContext.class);
    }

    @Override
    public <T extends ICompressionStats> Collection<T> getStatistics(Class<T> statsClass) throws DBException {
        return dbContext.select(statsClass);
    }
}
